import BusinessManageTemplate from "../pages/businessManage/businessManageTemplate";
import BusinessAdd from "../pages/businessManage/sub/businessAdd";
import BusinessDetail from "../pages/businessManage/sub/businessDetail";
import BusinessEdit from "../pages/businessManage/sub/businessEdit";
import BusinessManage from "../pages/businessManage/sub/businessManage";
import DictionaryTypeManageTemplate from "../pages/dictionaryTypeManage/dictionaryTypeManageTemplate";
import DictionaryTypeDetail from "../pages/dictionaryTypeManage/sub/dictionaryTypeDetail";
import DictionaryTypeManage from "../pages/dictionaryTypeManage/sub/dictionaryTypeManage";
import EmailTemplate from "../pages/email/emailTemplate";
import Email from "../pages/email/sub/email";
import ErrorBoundary from "./errorBoundary";
import NotFound from "../pages/error/404";
import GoodManageTemplate from "../pages/goodManage/goodManageTemplate";
import GoodAdd from "../pages/goodManage/sub/goodAdd";
import GoodDetail from "../pages/goodManage/sub/goodDetail";
import GoodEdit from "../pages/goodManage/sub/goodEdit";
import GoodManage from "../pages/goodManage/sub/goodManage";
import Home from "../pages/home";
import Login from "../pages/login";
import LogManageTemplate from "../pages/logManage/logManageTemplate";
import LogManage from "../pages/logManage/sub/logManage";
import MyTemplate from "../pages/my/myTemplate";
import My from "../pages/my/sub/my";
import OrderManageTemplate from "../pages/order/orderManageTemplate";
import OrderManage from "../pages/order/sub/orderManage";
import PromoteManageTemplate from "../pages/promoteManage/promoteManageTemplate";
import PromoteAdd from "../pages/promoteManage/sub/promoteAdd";
import PromoteManage from "../pages/promoteManage/sub/promoteManage";
import MyLayout from "../pages/shared/myLayout";
import SupplierAdd from "../pages/supplierManage/sub/supplierAdd";
import SupplierDetail from "../pages/supplierManage/sub/supplierDetail";
import SupplierEdit from "../pages/supplierManage/sub/supplierEdit";
import SupplierManage from "../pages/supplierManage/sub/supplierManage";
import SupsupplierManageTemplate from "../pages/supplierManage/supplierManageTemplate";

const routes = [
  {
    name: "模板页",
    path: "/",
    Component: MyLayout,
    errorElement: <ErrorBoundary />,
    children: [
      { name: "首页", index: true, Component: Home },
      {
        name: "商品管理模板页",
        path: "good",
        Component: GoodManageTemplate,
        children: [
          {
            name: "商品管理",
            index: true,
            Component: GoodManage,
          },
          {
            name: "商品添加",
            path: "add",
            Component: GoodAdd,
          },
          {
            name: "商品详情",
            path: "detail/:id",
            Component: GoodDetail,
          },
          {
            name: "商品编辑",
            path: "edit/:id",
            Component: GoodEdit,
          },
        ],
      },
      {
        name: "字典类别管理模板页",
        path: "dictionaryType",
        Component: DictionaryTypeManageTemplate,
        children: [
          {
            name: "字典管理",
            index: true,
            Component: DictionaryTypeManage,
          },
          {
            name: "字典类别详情",
            path: "detail/:id",
            Component: DictionaryTypeDetail,
          },
        ],
      },
      {
        name: "供应商管理模板页",
        path: "supplier",
        Component: SupsupplierManageTemplate,
        children: [
          {
            name: "供应商管理",
            index: true,
            Component: SupplierManage,
          },
          {
            name: "供应商添加",
            path: "add",
            Component: SupplierAdd,
          },
          {
            name: "供应商详情",
            path: "detail/:id",
            Component: SupplierDetail,
          },
          {
            name: "供应商编辑",
            path: "edit/:id",
            Component: SupplierEdit,
          },
        ],
      },
      {
        name: "商家管理模板页",
        path: "business",
        Component: BusinessManageTemplate,
        children: [
          {
            name: "商家管理",
            index: true,
            Component: BusinessManage,
          },
          {
            name: "商家添加",
            path: "add",
            Component: BusinessAdd,
          },
          {
            name: "商家详情",
            path: "detail/:id",
            Component: BusinessDetail,
          },
          {
            name: "商家编辑",
            path: "edit/:id",
            Component: BusinessEdit,
          },
        ],
      },
      {
        name: "订单管理模板页",
        path: "order",
        Component: OrderManageTemplate,
        children: [
          {
            name: "订单管理",
            index: true,
            Component: OrderManage,
          },
        ],
      },
      {
        name: "活动管理模板页",
        path: "promote",
        Component: PromoteManageTemplate,
        children: [
          {
            name: "活动管理",
            index: true,
            Component: PromoteManage,
          },
          {
            name: "活动添加",
            path: "add",
            Component: PromoteAdd,
          },
        ],
      },
      {
        name: "日志管理模板页",
        path: "log",
        Component: LogManageTemplate,
        children: [
          {
            name: "日志管理",
            index: true,
            Component: LogManage,
          },
        ],
      },
      {
        name: "我的模板页",
        path: "my",
        Component: MyTemplate,
        children: [
          {
            name: "我的",
            index: true,
            Component: My,
          },
        ],
      },
      {
        name: "邮箱模板页",
        path: "email",
        Component: EmailTemplate,
        children: [
          {
            name: "邮箱",
            index: true,
            Component: Email,
          },
        ],
      },
    ],
  },

  {
    path: "/login",
    Component: Login,
  },
  {
    path: "*",
    Component: NotFound,
  },
];

export default routes;
